package cn.tedu.spring.resource;

import cn.tedu.spring.config.SpringConfig;
import cn.tedu.spring.resource.controller.ReController;
import cn.tedu.spring.resource.service.ReService;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestResource {

    @Test
    public void testRe(){
        ApplicationContext context=new ClassPathXmlApplicationContext
                ("bean.xml");
        ReController Controller=context.getBean(ReController.class);
        Controller.cont();
    }
    @Test
    public void configTest(){
        ApplicationContext context=
                new AnnotationConfigApplicationContext(SpringConfig.class);
        ReController controller=context.getBean(ReController.class);
        controller.cont();
    }
}
